<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>外边距典型应用</title>
    <style>
        .header{
            width: 900px;
            height: 200px;
            background-color: skyblue;
            /* margin: auto; */
            margin: 0 auto;
            /* 文字或图片居中 */
            /* 行内块元素居中 */
            text-align: center;
        }
    </style>
</head>
<body>
    <div class="header">
        <span>文字或图片居中</span>
    </div>
</body>
</html>